from constants import *
import PIL
import os
from PIL import Image

for filen in os.listdir(data_dir):    
    # reduce size of image
    img = Image.open(data_dir+os.sep+filen)
    img = img.resize((300,int(300./img.size[0]*img.size[1])),Image.ANTIALIAS)
    img.save(file_dir+os.sep+filen)
print "done"
